package team.seekers.catering.common.enums;

import com.baomidou.mybatisplus.core.enums.IEnum;
import lombok.Getter;

import java.util.Arrays;

@Getter
public enum OrderPackEnum implements IEnum<Integer> {
    FOR_PACK("打包",1),
    /**
     * 等待接单
     */
    NOT_PACK("堂食", 0);

    private String name;
    private int type;

    OrderPackEnum(String name, int type) {
        this.name = name;
        this.type = type;
    }

    public static OrderPackEnum getByType(Integer type) {
        return Arrays.stream(values()).filter(e -> e.getType() == type).findFirst().orElse(null);
    }

    @Override
    public Integer getValue() {
        return this.type;
    }
}
